package com.pennphoto.shared;

import java.util.Date;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class StuFieldVerifier {
	
	public static String isValidName(String c_yr,String major,String advisor,String gpa) {
		String error=null;
		if(!c_yr.equals("")){	
	    char[]arr = c_yr.toCharArray();
	    int len=0;
	    for(int i=0;i<arr.length;i++)
	    {
	    	char c=arr[i];
	    	if(Character.isLetter(c))
	    		len++;
	    		    	
	    }
	    if(len!=0){
	    	error="Your Current year field should contain only digits";
	    }
		}
		if(!gpa.equals("")){
	    char[]arr1 = gpa.toCharArray();
	    int len1=0;
	    for(int i=0;i<arr1.length;i++)
	    {
	    	char c1=arr1[i];
	    	if(Character.isLetter(c1))
	    		len1++;
	    		    	
	    }
	    if(len1!=0){
	    	error="Your GPA should cannot have alphabets in it";
	    }
		}
		
		//return username.length() > 3;
		return error;
	}

}
